package com.bsj.power.common.util;

/**
 * @author yinhao
 * @version 1.0
 * @description 用于解析自定义传输的ssrc数据
 * @date 2024/6/20
 */
public class SsrcUtil {

    /**
     * 返回长度为10的ssrc
     * @param num:
     * @return
     **/
    public static String formatInt(long num) {
        String str = Long.toString(num);
        if (str.length() > 10) {
            str = str.substring(str.length() - 10);
        } else if (str.length() < 10) {
            StringBuilder sb = new StringBuilder(str);
            while (sb.length() < 10) {
                sb.insert(0, '0');
            }
            str = sb.toString();
        }
        return str;
    }
}
